//
//  MineCell.swift
//  newSwift
//
//  Created by MAC on 2023/10/19.
//

import UIKit



class MineCell : UITableViewCell {
    
    
    static let reuseId = "MineCell"
    
    lazy var iconImv = {
        let imv = UIImageView()
        return imv
    }()
    
    lazy var titleLabel = {
        let label = UILabel()
        label.font = .systemFont(ofSize: 14, weight: .medium)
        label.textColor = UIColor.init(hex: 0x333333)!
        return label
    }()
    lazy var arrowImv = {
        let imv = UIImageView()
        imv.image = R.image.pxarrow_right()
        return imv
    }()

    
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setupViews()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    func setupViews(){
        
//        self.contentView.backgroundColor = .clear
//        self.backgroundColor = .clear
        
        self.selectionStyle = .none

        
        contentView.addSubview(iconImv)
        contentView.addSubview(titleLabel)
        contentView.addSubview(arrowImv)
        
        iconImv.snp.makeConstraints { make in
            make.left.equalTo(15)
            make.centerY.equalToSuperview()
            make.height.width.equalTo(24)
        }
        
        titleLabel.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(iconImv.snp.right).offset(10)
        }
        
        arrowImv.snp.makeConstraints { make in
            make.right.equalTo(-15)
            make.centerY.equalToSuperview()
            make.height.width.equalTo(16)
        }
        
    }
    
    override var frame:CGRect{
         didSet {
             var newFrame = frame
             newFrame.origin.x += 10
             newFrame.size.width -= 20
             super.frame = newFrame
         }
     }
    
}
